<?php

class PublicAction extends Action {
    /*
     * 退出系统
     */

    public function logout() {
        unset($_SESSION['user_role']);
        $this->redirect('Admin/Public/login');
    }

    public function login() {
        $this->display();
    }

    public function checklogin() {
        if (empty($_REQUEST['username'])) {
            $this->redirect('Admin/Public/login');
        }
        $_SESSION['user_role'] = $_REQUEST['username'];
        $_SESSION['user_name'] = '小张';
        $this->redirect('Admin/Index/index');
    }

}

?>
